<template>
	<view class="content">
		<view class="outside">
			<view v-for="(item,index) in list" :key="item.id" class="middle">
				<image :src="imageUrl+item.icon" class="imgs"></image>
				<view class="characters">
					<view class="title">{{item.title}}</view>
					<view class="substance">{{item.content}}</view>
					<view @click="getUserPolicyInfo(item.id)" class="btn">
						查看更多
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getUserPolicyInfoApi
	} from '@/api/userPolicyInfo.js';
	export default {
		data() {
			return {
				list: [{
						id: 1,
						icon: '/policy/just.png',
						title: '瓜州有哪些政策？',
						content: '了解瓜州整体产业环境、证件办理、人才与企业扶持等相关人才政策。'
					},
					{
						id: 2,
						icon: '/policy/back.png',
						title: '我能享受什么政策？',
						content: '可根据您的身份及需求，为您个性化推荐您可能适用的人才政策。'
					},
				],
				imageUrl: ''
			}
		},
		methods: {

			getUserPolicyInfo(id) {
				if (id == 1) {
					uni.navigateTo({
						url: '/page_other/policy/detail?type=1&zcType=1'
					})
				} else {
					// getUserPolicyInfoApi().then((res) => {
					// 	console.log(this.identity)
					// 	var toUrl = '';
					// 	if (this.identity == 2) {
					// 		toUrl = '/page_other/policy/detail?type=1&zcType=2';
					// 	} else {
					// 		if (res === 1) {
					// 			toUrl = '/page_other/policy/detail?type=1&zcType=2';
					// 		} else {
					// 			toUrl = '/page_other/policy/resume';
					// 		}
					// 	}	
					uni.navigateTo({
						url: toUrl
					})
					// }).catch((res) => {
					// 	uni.hideLoading()
					// })
				}
			},
		},
		// computed: {
		// 	identity() {
		// 		return this.$store.getters.identity
		// 	}
		// },
		onLoad() {
			this.imageUrl = this.globalConfig.imageUrl;
			this.showLoading = false
		}
	}
</script>

<style lang="scss">
	.content {
		width: 100%;
		height: 100vh;
		background: url("https://job-1306862033.cos.ap-chengdu.myqcloud.com/miniprogram-static/policy/background.jpg");
		background-repeat: no-repeat;
		background-size: 100%;
		padding: 30rpx;

		.outside {
			padding-top: 165px;


			.middle {
				width: 100%;
				height: 180px;
				border-radius: 20rpx;

				background: rgba(255, 255, 250, 0.7);
				margin-top: -10rpx;
				display: flex;
				border-bottom: 1px solid #efefef;
				padding: 30rpx;
				margin-bottom: 100rpx;

				.characters {
					padding-left: 30rpx;
					color: #FC0A3D;

					.title {
						font-size: 34rpx;
						font-weight: bold;
					}

					.substance {
						padding-top: 30rpx;
						line-height: 25px;
					}
				}

				.btn {
					width: 180rpx;
					height: 60rpx;
					line-height: 58rpx;
					border-radius: 40rpx;
					text-align: center;
					color: #fff;
					background-color: #ff7626;
					font-size: 28rpx;
					margin-left: 120px;
				}

				.imgs {
					width: 280px;
					height: 150px;
				}
			}
		}
	}
</style>